package com.jiajia.study.stack;

/**
 * <h1>栈内存溢出 -> 递归的原因 </h1>
 *
 * -Xss256k
 * @author zjiajia
 * @date 2023/11/12 20:48
 */
public class Demo5 {
    private static int count;
    public static void main(String[]args){
        try {
            method1();
            // Exception e 的异常是异步打印的
        } catch (Throwable e) {
            e.printStackTrace();
            System.out.println(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" + count);
        }

    }

    private static void method1() {
        count++;
        method1();
    }

}
